<?php

namespace app\api\Common;
header("Access-Control-Allow-Origin:*");
class Common{
    //参数为状态码、数据、查询总数、提示信息
    public function Json($code,$data,$count,$info)
    {
      header("content-type:text/html;charset=utf-8");
      header('Access-Control-Allow-Origin:*');
      $arr = array("code" => $code,"info" => $info, "count" => $count ,"data" => $data);
      //转成json格式
      $json = json_encode($arr);
      echo $json;
    }
}